# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=hicolor-icon-theme
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.17
pkgrel=1
pkgdesc="Freedesktop.org Hicolor icon theme (mingw-w64)"
arch=('any')
url="https://wiki.freedesktop.org/www/Software/icon-theme/"
license=("GPL2")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
install=${_realname}-${CARCH}.install
options=('!libtool' 'strip' 'staticlibs')
source=("https://icon-theme.freedesktop.org/releases/${_realname}-${pkgver}.tar.xz")
sha256sums=('317484352271d18cbbcfac3868eab798d67fff1b8402e740baa6ff41d588a9d8')

build() {
  [[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST}
  mkdir ${srcdir}/build-${MINGW_CHOST}
  cd ${srcdir}/build-${MINGW_CHOST}
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST}

  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="${pkgdir}" install

  install -Dm644 "${srcdir}/${_realname}-${pkgver}"/COPYING ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING
}
